<script setup lang="ts">
import { ref } from 'vue'
// import { Document, Menu, Location, Setting} from '@element-plus/icons-vue'
import { ElWatermark } from 'element-plus'
import {Fold, Expand } from '@element-plus/icons-vue'

const layoutisCollapse = ref(false)
const time = new Date()
const localString = time.toLocaleString('zh-CN', {
  year: 'numeric',
  month: '2-digit',
  day: '2-digit',
  hour: '2-digit',
  minute: '2-digit',
  second: '2-digit',
  hour12: false
});
</script>
<template>
  <div class="common-layout">

    <!-- :font="{ size: 16, color: 'rgba(0, 0, 0, 0.15)' }" -->
    <el-watermark
      :content="['山东大学齐鲁交通学院', localString]"
      :font="{ color: 'rgba(0, 0, 0, 0.15)' }"
      :gap="[100, 100]"
      :rotate="-22"
    >
      <!-- 需要加水印的内容区域 -->
      <!-- <div class="content">这里是受保护的内容区域</div> -->


      <el-container>
        <el-aside :width="layoutisCollapse ? '64px':'200px'" class="elaside">
          <div v-show="!layoutisCollapse" class="elaside-head">
            <div>
              <img src="../../pictures/sdu.png" alt="logo">
              <span style="elaside-head">后台管理系统</span>
            </div>
          </div>
          <div v-show="layoutisCollapse" class="elaside-head">
            <div>
              <img src="../../pictures/sdu.png" alt="logo">
            </div>
          </div>
          <div class="elaside-head-line"></div>
          <!-- <el-divider /> -->
          <!-- background-color="#222832" -->
          <el-menu
            class="el-menu-vertical-demo"
            :collapse="layoutisCollapse"
            :unique-opened="true"
            :collapse-transition="false"
            background-color="#222832"
            text-color="#fff"
            :router="true"
            >

            <el-menu-item index="/AdminIndexPage">
              <el-icon><setting /></el-icon>
              <span>首页</span>
            </el-menu-item>

            <el-sub-menu>
              <template #title>
                <el-icon><tools /></el-icon><span>综合地质预报</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="/ItemPage_1/DataPage"><el-icon><tools /></el-icon>数据管理</el-menu-item>
                <el-menu-item index="/ItemPage_1/EngineeringPage"><el-icon><tools /></el-icon>工程项目管理</el-menu-item>
              </el-menu-item-group>
            </el-sub-menu>

            <el-sub-menu index="ItemPage_2">
              <template #title>
                <el-icon><ticket /></el-icon><span>动态支护设计</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="/ItemPage_2/DataPage"><el-icon><tools /></el-icon>数据管理</el-menu-item>
                <el-menu-item index="/ItemPage_2/EngineeringPage"><el-icon><tools /></el-icon>工程项目管理</el-menu-item>
              </el-menu-item-group>
            </el-sub-menu>

            <el-sub-menu index="ItemPage_3">
              <template #title>
                <el-icon><unlock /></el-icon><span>施工动态监测</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="/ItemPage_3/DataPage"><el-icon><lock /></el-icon>数据管理</el-menu-item>
                <el-menu-item index="/ItemPage_3/EngineeringPage"><el-icon><lock /></el-icon>工程项目管理</el-menu-item>
              </el-menu-item-group>
            </el-sub-menu>

            <el-sub-menu index="ItemPage_4">
              <template #title>
                <el-icon><burger /></el-icon><span>结构质量检测</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="/ItemPage_4/DataPage"><el-icon><tools /></el-icon>数据管理</el-menu-item>
                <el-menu-item index="/ItemPage_4/EngineeringPage"><el-icon><tools /></el-icon>工程项目管理</el-menu-item>
              </el-menu-item-group>
            </el-sub-menu>

            <el-sub-menu index="ItemPage_5">
              <template #title>
                <el-icon><burger /></el-icon><span>风险动态评估</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="/ItemPage_5/DataPage"><el-icon><tools /></el-icon>数据管理</el-menu-item>
                <el-menu-item index="/ItemPage_5/EngineeringPage"><el-icon><tools /></el-icon>工程项目管理</el-menu-item>
              </el-menu-item-group>
            </el-sub-menu>

            <el-sub-menu index="UserAccount">
              <template #title>
                <el-icon><burger /></el-icon><span>账号管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="/UserAccount/DataPage"><el-icon><tools /></el-icon>数据管理</el-menu-item>
                <el-menu-item index="/UserAccount/EngineeringPage"><el-icon><tools /></el-icon>工程项目管理</el-menu-item>
              </el-menu-item-group>
            </el-sub-menu>

            <el-sub-menu index="Setting">
              <template #title>
                <el-icon><burger /></el-icon><span>设置</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="/Setting/DataPage"><el-icon><tools /></el-icon>数据管理</el-menu-item>
                <el-menu-item index="/Setting/EngineeringPage"><el-icon><tools /></el-icon>工程项目管理</el-menu-item>
              </el-menu-item-group>
            </el-sub-menu>
          </el-menu>
        </el-aside>

        <el-container>
          <el-header>
            <div class="elheader">
              <div class="header-left">
                <!-- style="float:left; margin-top: 10px;" -->
                <el-radio-group v-model="layoutisCollapse">
                  <el-icon v-show="!layoutisCollapse" @click="layoutisCollapse=true"><Fold /></el-icon>
                  <el-icon v-show="layoutisCollapse" @click="layoutisCollapse=false"><Expand /></el-icon>
                </el-radio-group>

                <div class="toVisualization">
                  <a href="http://localhost:5173/visualization"><div class="visualization_1">大屏首页</div></a>
                  <a href="http://localhost:5173/Visualization_1"><div class="visualization_1">综合地质预报</div></a>
                  <a href="http://localhost:5173/Visualization_2"><div class="visualization_1">动态支护设计</div></a>
                  <a href="http://localhost:5173/Visualization_3"><div class="visualization_1">施工动态监测</div></a>
                  <a href="http://localhost:5173/Visualization_4"><div class="visualization_1">结构质量检测</div></a>
                  <a href="http://localhost:5173/Visualization_5"><div class="visualization_1">风险动态评估</div></a>
                </div>
              </div>
              <div class="header-right">
                <a href="#"><div class="aboutSystem">关于系统</div></a>

                <div class="avatar">

                  <el-dropdown>

                      <el-avatar> 陆 </el-avatar>
                      <el-icon class="el-icon--right">
                        <arrow-down />
                      </el-icon>

                    <template #dropdown>
                      <el-dropdown-menu>
                        <el-dropdown-item>账户设置</el-dropdown-item>
                        <el-dropdown-item>修改密码</el-dropdown-item>
                        <el-dropdown-item divided><a href="http://localhost:5173">退出登录</a></el-dropdown-item>
                      </el-dropdown-menu>
                    </template>
                  </el-dropdown>

                  <!-- src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" -->
                  <!-- <el-avatar> 陆 </el-avatar> -->
                </div>
              </div>
            </div>
          </el-header>


            <el-main>
              <el-scrollbar auto>
                <div class="elmain">
                  <RouterView />
                </div>
              </el-scrollbar>

            </el-main>

        </el-container>
      </el-container>
    </el-watermark>
  </div>
</template>

<style scoped>
body {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  /* background-color: aqua; */
}
/* style="float:left; margin-top: 10px; margin-left: 0;" */
.el-radio-group {
  float: left;
  /* margin-top: 3px; */
  margin-left: 0;
  margin-right: 20px;
}
/* style="font-size:32px;" */
.el-radio-group .el-icon {
  font-size: 30px;
  cursor: pointer;
}

.common-layout {
  /* background-color: rgb(255, 162, 0); */
  overflow: hidden;
  height: 100vh;
}

a {
  text-decoration: none;
}

.elaside-head-line {
  border-top: 1px solid hsla(0,0%,100%,.05);
  border-bottom: 1px solid rgba(0,0,0,.2);
}
.el-menu-vertical-demo {
  min-height: 600px;
}
.el-menu {
  border-right: none!important;
}
.el-submenu {
  border-top: 1px solid hsla(0, 0%, 100%, .05);
  border-bottom: 1px solid rgba(0, 0, 0, .2);
}
.elaside {
  background-color: #222832;
  overflow: hidden;
  overflow-y: auto;
  -ms-overflow-style: none;
  overflow: -moz-scrollbars-none;
  height: 100vh;
}
.elaside::-webkit-scrollbar {
  display: none;
}
.elaside-head {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
}
.elaside-head > div {
  display: flex;
  align-items: center;
}
.elaside-head img {
  width: 40px;
  height: 40px;
  margin-left: 8px;
  margin-right: 8px;
}
.elaside-head span {
  font-size: 20px;
  color: #ffffff;
}
.elheader {
  height: 60px;
  line-height: 60px;
  display: flex;
  /* border-bottom: 1px solid #e9e9e9; */
  /* background-color: blue; */
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
}

.header-right {
  display: flex;
  /* background-color: cadetblue; */
}
.avatar {
  margin-left: 20px;
}
.el-avatar {
  background-color: rgb(48, 48, 48);
  margin-top: 10px;
  cursor: pointer;
}

.example-showcase .el-dropdown-link {
  cursor: pointer;
  color: var(--el-color-primary);
  display: flex;
  align-items: center;
}

.toVisualization {
  display: flex;
}

.visualization_1 {
  /* background-color: aqua; */
  /* margin-right: 3px; */

   /* 基础样式 */
  display: inline-block;
  padding: 22px 12px 0 12px;
  border-radius: 8px;
  text-decoration: none;
  font-family: "微软雅黑", sans-serif;
  font-size: 15px;
  /* line-height: 60px; */
  color: #000000; /* 白色文字 */
  /* background-color: #e2e2e2;  */
  /* border: 2px solid transparent;  */
  transition: all 0.3s ease; /* 统一过渡效果 */
  position: relative;
  overflow: hidden; /* 隐藏溢出内容 */
}

/* 动态光效背景 */
.visualization_1::before {
  content: "";
  position: absolute;
  left: -50%;
  width: 100%;
  height: 200%;
  background: linear-gradient(
    135deg,
    transparent,
    rgba(255, 255, 255, 0.1) 30%,
    transparent 70%
  );
  transform: skewX(-30deg);
  transition: transform 0.6s ease;
}

/* 悬停效果 */
.visualization_1:hover {
  background-color: #1a1a1a; /* 更深的黑色背景 */
  border-color: #444; /* 深灰边框 */
  color: #ffffff;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.3); /* 黑色投影 */
}

.visualization_1:hover::before {
  transform: skewX(-30deg) translateX(100%); /* 光效移动 */
}

/* 点击按压效果 */
.visualization_1:active {
  transform: scale(0.96); /* 缩小效果 */
  background-color: #000; /* 纯黑背景 */
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5); /* 更深投影 */
}

.el-header {
  /* background-color: blueviolet; */
  border-bottom: #d4d4d4 1px solid;
}
.elmain {
  height: 85vh;
  /* background-color: rgb(243, 243, 243); */
  /* overflow-y: auto; */
}
/* .el-main {
  background-color: cadetblue;
} */

</style>
